home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Video Toaster 4.3
/
Video Toaster v4.3.iso
/
3.1
/
toasterall
/
arexx_examples
/
toasterobics.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1993-06-06
|
8KB
|
278 lines
/* Toasterobics.rexx, Exersizes as many Arexx switcher functions as possible */
/* By Arnie Cachelin © 1991 NewTek Inc. */
/* Sat Jun 5 22:53:15 1993 */
OPTIONS RESULTS
TOASTERLIB="ToasterARexx.port"
ARG count
if count="" then count=0
SIGNAL ON ERROR
IF POS(TOASTERLIB , SHOW('Libraries')) = 0 THEN
IF ~ADDLIB(TOASTERLIB , 0) THEN x=Bummer(" Please start your Toaster.")
/* Set up convenient way of getting all switcher status info */
status.1="MAIN"
meaning.1="Program row state (2^n)"
status.2="PREV"
meaning.2="Preview row state (2^n)"
status.3="OVLY"
meaning.3="Overlay row state (2^n)"
status.4="FREZ"
meaning.4="Frozen Video?"
status.5="TEXT"
meaning.5="Text in keypad window"
status.6="TBAR"
meaning.6="T-Bar level"
status.7="KEYM" /* Luma Key: (black|white|off) */
meaning.7="Luminance Key mode"
status.8="CLIP"
meaning.8="Luminance Key level"
status.9="SPED" /* speed (S|M|F) for current effect */
meaning.9="Speed setting"
status.10="FCNT" /* # of frames for current effect */
meaning.10="Current effect frame count"
status.11="KNUM" /* keypad number */
meaning.11="Current keypad number"
status.12="GRID"
meaning.12="Current Effect #"
status.13="BANK"
meaning.13="Current Bank"
status.14="INFO"
meaning.14="Current Num. Keypad selection "
status.15="BACK"
meaning.15="Current Background Color"
status.16="BORD"
meaning.16="Current Border Color"
status.17="TERM"
meaning.17="Current Termination mask"
status.18="SGPI"
meaning.18="Current GPI mode"
status.19="FACE"
meaning.19="Current Monitor Mode"
status.20="FMDV"
meaning.20="Currently Available Framestore Devices"
status.21="PJDV"
meaning.21="Currently Available Project Devices"
status.22="FXNM"
meaning.22="Current Effect Name"
statnum=22
ans.0="No"
ans.1="Yes"
call Switcher(MDV1) /* put Program and Preview outputs on framestores */
call Switcher(PDV2)
Say "Current Effect: "CurrentEffect()
call ShowTermination
say "Screen bitmap at "d2x(Switcher(GROF))
call Switcher(GRON)
say "Setting 2 monitor mode"
call Switcher(FACE,2)
call Switcher(WAIT,30)
say "Setting 3 monitor mode"
call Switcher(FACE,3)
do i=1 to StatNum
say meaning.i" = "Switcher(STAT,status.i)
end
testdev="RAM:"
say "Current Project Device: "Switcher(PJNM)
say "Current Framestore Device: "Switcher(FSNM)
say "Let's look at "testdev
t=Switcher(PJCK,testdev)
say "Project dir on "testdev"? "ans.t
t=Switcher(FSCK,testdev)
say "Framestore dir on "testdev"? "ans.t
say "Room for "Switcher(FSCT,testdev)" frames on "testdev
if ~Switcher(PJCK,testdev) then
say "let's make a Project dir on "testdev": "Switcher(PJMK,testdev)
if ~Switcher(FSCK,testdev) then
say "let's make a Framestore dir on "testdev": "Switcher(FSMK,testdev)
t=Switcher(PJCK,testdev)
say "Project dir on "testdev"? "ans.t
t=Switcher(FSCK,testdev)
say "Framestore dir on "testdev"? "ans.t
say "Room for "Switcher(FSCT,testdev)" frames on "testdev
call Switcher(SGPI,POS) /* Set GPI trigger to positive (leading edge of pulse) */
/* Switcher(WAIT,GPI) */ /* Wait for GPI trigger to come in */
call Switcher(KEYM) /* Toggle Luma Key mode (B or W) */
call Switcher(FRES) /* Reset frame counter for Wait below */
call Switcher(O001) /* Overlay to input 1 */
do i=0 to 257 by 10
call Switcher(CLIP,i) /* Set key clip level */
call Switcher(WAIT,60) /* Wait for a number of frames (30/sec) */
end
call Switcher(KOFF)
call Switcher(TOSW)
/* call Switcher(WAIT,GPI) */ /* Wait for GPI trigger to come in */
do i=0 to 511 by 10
call Switcher(TBAR,i) /* Set T-Bar level */
call Switcher(WAIT,60) /* Wait for a number of frames (30/sec) */
end
call Switcher(AUTO)
call Switcher(CHGR,'A') /* Change grid (A-I) */
call Switcher(WAIT,40)
call Switcher(CHGR,'B')
Call Switcher(WAIT,40)
Call Switcher(CHGR,'C')
Call Switcher(WAIT,40)
Call Switcher(CHGR,'D')
Call Switcher(WAIT,40)
Call Switcher(CHGR,'E')
Call Switcher(WAIT,40)
Call Switcher(CHGR,'F')
Call Switcher(WAIT,40)
Call Switcher(CHGR,'G')
Call Switcher(WAIT,40)
Call Switcher(CHGR,'H')
Call Switcher(WAIT,40)
Call Switcher(CHGR,'I')
Call Switcher(WAIT,40)
Say "Freeze: "Switcher(STAT,FREZ)
Call Switcher(FREZ)
Say "Freeze: "Switcher(STAT,FREZ)
Call Switcher(FREZ)
Say "Freeze: "Switcher(STAT,FREZ)
say "Free chip memory: "Switcher(MEMC)
say "Largest free chip memory: "Switcher(MEMC,L)
say "Free fast memory: "Switcher(MEMF)
say "Largest free fast memory: "Switcher(MEMF,L)
pre.=""
pre.0="MEDM"
pre.1="FAST"
pre.2="SVAR"
pre.3="SLOW"
t=Switcher(STAT,FXNM)
Say "Current Effect: "t
sp=Switcher(STAT,SPED)
preset=bitand(sp,3)
varsp=(bitclr(sp,0))
varsp=(bitclr(varsp,1))/4
say "Current Speed: "pre.preset" Variable Rate: "varsp
do i=0 to 3
call Switcher(pre.i)
end
do i=1 to count
say "Loading Paint"
Call Switcher(LDTP) /* Load ToasterPaint */
say "Did it work: "Switcher(CKTP)
say "Free chip memory: "Switcher(MEMC)
say "Largest free chip memory: "Switcher(MEMC,L)
say "Free fast memory: "Switcher(MEMF)
say "Largest free fast memory: "Switcher(MEMF,L)
/* say "Entering Paint" */
/* Call Switcher(STTP) */ /* Enter ToasterPaint */
/* say "Leaving Paint" */
/* Address 'DigiPaint' 'Quit' */
/* say "Back in switcher!" */
say "Loading LightWave"
Call Switcher(LDLW) /* Load LightWave */
say "Did it work: "Switcher(CKLW)
say "Free chip memory: "Switcher(MEMC)
say "Largest free chip memory: "Switcher(MEMC,L)
say "Free fast memory: "Switcher(MEMF)
say "Largest free fast memory: "Switcher(MEMF,L)
say "Loading CG"
Call Switcher(LDCG) /* Load ToasterCG */
say "Did it work: "Switcher(CKCG)
say "Free chip memory: "Switcher(MEMC)
say "Largest free chip memory: "Switcher(MEMC,L)
say "Free fast memory: "Switcher(MEMF)
say "Largest free fast memory: "Switcher(MEMF,L)
say "Unloading CG"
Call Switcher(DPCG) /* Unload ToasterCG */
say "Did it work: "Switcher(CKCG)
say "Free chip memory: "Switcher(MEMC)
say "Largest free chip memory: "Switcher(MEMC,L)
say "Free fast memory: "Switcher(MEMF)
say "Largest free fast memory: "Switcher(MEMF,L)
say "Unloading LightWave"
Call Switcher(DPLW) /* Unload LightWave */
say "Did it work: "Switcher(CKLW)
say "Free chip memory: "Switcher(MEMC)
say "Largest free chip memory: "Switcher(MEMC,L)
say "Free fast memory: "Switcher(MEMF)
say "Largest free fast memory: "Switcher(MEMF,L)
say "Unloading Paint"
Call Switcher(DPTP) /* Unload ToasterPaint */
say "Did it work: "Switcher(CKTP)
say "Free chip memory: "Switcher(MEMC)
say "Largest free chip memory: "Switcher(MEMC,L)
say "Free fast memory: "Switcher(MEMF)
say "Largest free fast memory: "Switcher(MEMF,L)
end
Call Switcher(TOWB)
EXIT
CutAndFade: Procedure /* Select fade transition for pulsing effect */
Call Switcher(TAKE)
Call Switcher(AUTO)
return 1
RandomCrouton: PROCEDURE /* Select a random crouton!, some may not do the right thing! */
grd=translate(random(1,6),"ABCDEF","123456") /* random letter generator! */
TOASTCmd= "t=Switcher(Grid,"GRD||RANDOM(1,4)||RANDOM(1,8)||")"
SAY TOASTCmd
INTERPRET TOASTCmd
return t
LoopKeyPad: Procedure /* loop through all keypad choices 'til we're back */
arg DoMe /* optional command to execute with each number */
N=Switcher(STAT,KNUM) /* Get the keypad number */
c=1
Call Switcher(KEYP) /* press the '+' key */
do While Switcher(STAT,KNUM)~=N
Call Switcher(KEYP)
c=c+1
/* if DoMe~="" Then do */
/* interpret DoMe */
/* end */
end
return c
ERROR:
call Switcher(TOWB)
say 'Sorry, Error #'RC' on line 'SIGL' has been detected.'
say ErrorText(RC)
say sourceline(SIGL)
call Bummer()
return
Bummer: PROCEDURE
arg etxt
say etxt
EXIT
return 0
ShowTermination: PROCEDURE
mask=Switcher(STAT,TERM)
do i=1 to 4
if BITTST(mask,4-i) then TS.i='ON'
else TS.i="OFF"
end
Say "Current Termination Settings (mask="mask" ("right(c2b(d2x(mask)),4)")):"
do i=1 to 4
Say ' Input'i' = 'TS.i
end
return mask
CurrentEffect: PROCEDURE
effect=Switcher(STAT,GRID)
if effect<=0 then return ""
n=Switcher(STAT,BANK)
cbank=translate(n,'ABCDEFGHI','012345678')
fx=effect - (n)*32 /* Position relative to bank start */
row=(fx%8) + 1
col=(fx//8) + 1
say "FX#: "effect fx" Bank: "cbank"("n") Row: "row" Col: "col
return(cbank||row||col)